package com.ikun.oss.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description: minio配置管理
 * @Author: gqh
 * @Date: 2024/5/9 12:37
 */
@Configuration
public class MinioConfig {

    //minioUrl
    @Value("${minio.url}")
    private String url;
    //minio账户
    @Value("${minio.accessKey}")
    private String accessKey;
    //minio密码
    @Value("${minio.secretKey}")
    private String secretKey;

    /**
     * @Description: 构造minioClient
     * @Author: gqh
     * @Date: 2024/5/9 13:14
     */
    @Bean
    public MinioClient getMinioClient() {
        return MinioClient.builder().endpoint(url).credentials(accessKey, secretKey).build();
    }


}
